package com.sunni.test;

import com.situ.mianXiangDuiXiang.entity.CPUobj;
import com.situ.mianXiangDuiXiang.entity.CardObj;
import com.situ.mianXiangDuiXiang.entity.ComputerObj;
import com.situ.mianXiangDuiXiang.entity.DisplayObj;
import com.sunni.entity.Borrow;
import com.sunni.repository.BorrowRepository;
import com.sunni.repository.impl.BorrowRepositoryImpl;
import com.sunni.service.BookService;
import com.sunni.service.impl.BookServiceImpl;
import org.junit.Test;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class test {
    BorrowRepository borrowRepository = new BorrowRepositoryImpl();
    BookService bookService = new BookServiceImpl();
    @Test
    public void test000(){
        System.out.println(bookService.getPageCountBorrowByState0(0));
        List<Borrow> list = bookService.findAllByState0(0,1);
        for (Borrow borrow : list) {
            System.out.println(borrow);
        }
    }

    @Test
    public void StudentTest(){
        ComputerObj computer01 = new ComputerObj(new DisplayObj("三星", 32), new CPUobj("AMD", 7));
        computer01.jisuan(22.0,44.5);
    }

    @Test
    public void ATMTest(){
       CardObj card01 = new CardObj(111111,100.0);
       CardObj card02 = new CardObj(222222,100.0);

       card01.updateMoney(card02,20.0);

        System.out.println(card01);
        System.out.println(card02);
        for (int i = 0; i < 10; i++) {
            System.out.println();
        }
    }

    @Test
    public void ATM(){
        Scanner scanner = new Scanner(System.in);
        while (true){
            System.out.print("请输入：");int num = scanner.nextInt();
            switch (num){

            }
        }

    }
}
